/** @jsxRuntime automatic */
/** @jsxImportSource ../xml-runtime */

function Mono({
  pathObject,
  index,
  idPrefix,
  startFrame,
  endFrame,
  totalStart,
  totalEnd,
  renderLinks,
}) {
  return (
    <clipitem id={idPrefix + index}>
      <file id="s"></file>
      <name>{pathObject.name}</name>
      <start>{totalStart}</start>
      <end>{totalEnd}</end>
      <in>{startFrame}</in>
      <out>{endFrame}</out>
      {renderLinks && renderLinks(index)}
    </clipitem>
  )
}

function Stereo({
  pathObject,
  index,
  idPrefix,
  startFrame,
  endFrame,
  totalStart,
  totalEnd,
  trackIndex,
  renderLinks,
}) {
  return (
    <clipitem id={idPrefix + index} premiereChannelType="stereo">
      <file id="s"></file>
      <name>{pathObject.name}</name>
      <start>{totalStart}</start>
      <end>{totalEnd}</end>
      <in>{startFrame}</in>
      <out>{endFrame}</out>
      <sourcetrack>
        <mediatype>audio</mediatype>
        <trackindex>{trackIndex}</trackindex>
      </sourcetrack>
      {renderLinks && renderLinks(index)}
    </clipitem>
  )
}

export const ClipItem = { Mono, Stereo }
